import { Get, Inject, Provide, Query } from '@midwayjs/decorator';
import { CoolController, BaseController } from '@cool-midway/core';
import { DoupiaopiaoCommissionService } from '../../service/commission';
import { DoupiaopiaoCommissionEntity } from '../../entity/commission';
/**
 * 分佣相关
 */
@Provide()
@CoolController({
  api: [],
  entity: DoupiaopiaoCommissionEntity,
  service: DoupiaopiaoCommissionService,
})
export class BusinessAppCommissionController extends BaseController {
  @Inject()
  doupiaopiaoCommissionService: DoupiaopiaoCommissionService;
  /**
   * 获取当前登录用户的粉丝列表
   */
  @Get('/fansList', { summary: '获取粉丝列表' })
  async getfansList(@Query() query) {
    const res = await this.doupiaopiaoCommissionService.getList(query);
    return this.ok(res);
  }
  /**
   * 获取当前登录用户的粉丝订单列表
   */
  @Get('/fansOrderList', { summary: '获取粉丝订单列表' })
  async getFansOrder(@Query() query) {
    const res = await this.doupiaopiaoCommissionService.getOrderList(query);
    return this.ok(res);
  }
  //用户实现当前的提现
  @Get('/withdraw', { summary: '当前用户提现' })
  async withDraw(@Query() query) {
    const res = await this.doupiaopiaoCommissionService.withDraw(query);
    return this.ok(res);
  }
  //获取用户提现的记录列表
  @Get('/withHistory', { summary: '获取用户提现的记录' })
  async withHistoryList(@Query() query) {
    const res = await this.doupiaopiaoCommissionService.getWithHistory(query);
    return this.ok(res);
  }
  //获取用户的一些佣金的信息
  @Get('/withData', { summary: '获取当前用户的一些佣金信息' })
  async withData(@Query() query) {
    const res = await this.doupiaopiaoCommissionService.getCommissionData(
      query
    );
    return this.ok(res);
  }
}
